import request from '@/utils/request'
import qs from 'qs'

export function initData(url, params) {
  return request({
    url: url + '?' + qs.stringify(params, { indices: false }),
    method: 'get'
  })
}

export function download(url, params) {
  return request({
    url: url + '?' + qs.stringify(params, { indices: false }),
    method: 'get',
    responseType: 'blob'
  })
}

// 业务效能-累计事件 
export function cumulativeEvents(data) {
  return request({
    url: '/system/statistical/supervise/realtime/new/efficiency/view/top',
    method: 'get',
    params: data
  })
}

// 业务效能-事件时效 
export function eventsTime(data) {
  return request({
    url: '/system/statistical/supervise/realtime/new/efficiency/view/source',
    method: 'get',
    params: data
  })
}

// 业务效能-案件占比
export function proportionOfCases(data) {
  return request({
    url: '/system/statistical/supervise/realtime/new/efficiency/view/category',
    method: 'get',
    params: data
  })
}

// 业务效能-排名
export function superviseRealtime(data) {
  return request({
    url: '/system/statistical/supervise/realtime/ranking',
    method: 'get',
    params: data
  })
}

// 业务效能-获取累计事件详情
export function getCaseDeiltes(data) {
  return request({
    url: '/web-api/system/statistical/supervise/realtime/potency/case/detailed',
    method: 'get',
    params: data
  })
}

// 业务效能-获取投诉件、表扬件详情
export function getCaseDeiltes1(data) {
  return request({
    url: '/web-api/system/statistical/supervise/realtime/control/outline/detailed',
    method: 'get',
    params: data
  })
}

// 业务效能-风险防控 
export function riskControl(data) {
  return request({
    url: '/web-api/system/statistical/supervise/realtime/control/type',
    method: 'get',
    params: data
  })
}

// 业务效能-风险防控 -- 顶部摘要
export function abstract(data) {
  return request({
    url: '/web-api/system/statistical/supervise/realtime/control/outline',
    method: 'get',
    params: data
  })
}

// 业务效能-风险防控 -- 投诉件、表扬件
export function complaintCase(data) {
  return request({
    url: '/web-api/system/statistical/supervise/realtime/control/outline/detailed',
    method: 'get',
    params: data
  })
}
// 分割线------------------------------------------
// 满意度顶部
export function satisfactionH(data) {
  return request({
    url: '/system/statistical/supervise/realtime/new/satisfaction/view/top',
    method: 'get',
    params: data
  })
}
// 满意度考核-视图-不满意案件类型占比
export function dissatisfiedScale(data) {
  return request({
    url: '/system/statistical/supervise/realtime/new/satisfaction/view/category',
    method: 'get',
    params: data
  })
}
// 首页左侧数据
export function leftTotal(data) {
  return request({
    url: '/system/statistical/supervise/realtime/new/left/count',
    method: 'get',
    params: data
  })
}